package com.qyt.hotel.service.impl;

import com.qyt.hotel.dao.GuestMapper;
import com.qyt.hotel.entity.Guest;
import com.qyt.hotel.entity.ResideState;
import com.qyt.hotel.service.GuestService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class GuestServiceImpl implements GuestService {

    @Resource
    private GuestMapper guestMapper;

    @Override
    public List<Guest> getGuestList(String guestName, Integer resideStateId) {
        return guestMapper.getGuestList(guestName, resideStateId);
    }

    @Override
    public List<ResideState> getResideStateList() {
        return guestMapper.getResideStateList();
    }

    @Override
    public List<String> getRoomIdList(Integer roomTypeId, Integer roomStateId) {
        return guestMapper.getRoomIdList(roomTypeId, roomStateId);
    }

    @Override
    public Integer addGuest(String guestName, Integer guestNum, String identityId, String phone, String resideDate, Integer roomTypeId, String roomId, Double deposit) {
        return guestMapper.addGuest(guestName, guestNum, identityId, phone, resideDate, roomTypeId, roomId, deposit);
    }

    @Override
    public Integer updateRoomStateFree(String roomId) {
        return guestMapper.updateRoomStateFree(roomId);
    }

    @Override
    public Integer updateRoomState(String roomId) {
        return guestMapper.updateRoomState(roomId);
    }

    @Override
    public Guest getOne(Integer guestId) {
        return guestMapper.getOne(guestId);
    }

    @Override
    public Integer updateGuest(Integer guestId, String guestName, Integer guestNum, String identityId, String phone, String resideDate, Integer roomTypeId, String roomId, Double deposit) {
        return guestMapper.updateGuest(guestId, guestName, guestNum, identityId, phone, resideDate, roomTypeId, roomId, deposit);
    }

    @Override
    public Integer updateOldRoomState(String oldRoomId) {
        return guestMapper.updateOldRoomState(oldRoomId);
    }

    @Override
    public void deleteGuest(Integer guestId) {
        guestMapper.deleteGuest(guestId);
    }

    @Override
    public void checkout(Integer guestId, Double totalMoney, String leaveDate) {
        guestMapper.checkout(guestId, totalMoney, leaveDate);
    }

}
